import request from '@/utils/request'

// 查询对话列表
export function listChat() {
  return request({
    url: '/chat', method: 'get'
  })
}

// 新增对话
export function addChat(title) {
  return request({
    url: '/chat', method: 'post', data: {
      title: title
    }
  })
}

// 更新对话
export function updateChat(chatId, title) {
  return request({
    url: '/chat', method: 'put', data: {
      chatId: chatId, title: title
    }
  })
}

// 删除对话
export function deleteChat(chatId) {
  return request({
    url: '/chat/' + chatId, method: 'delete'
  })
}
